package createPattern.factoryPattern.simpleFactory.factory;

import createPattern.factoryPattern.simpleFactory.product.BugattiCar;
import createPattern.factoryPattern.simpleFactory.product.Car;
import createPattern.factoryPattern.simpleFactory.product.PorscheCar;

public class CarFactory {

	public static Car getCarByType(String type, String name, String color) {
		if (type.toLowerCase().equals("porsche")) {
			return new PorscheCar(name, color, 3.2, 2, 1.8);
		} else if (type.toLowerCase().equals("bugatti")) {
			return new BugattiCar(name, color);
		} else {
			return null;
		}
	}
}
